#version 150

in  vec2 texCoord;
out vec4 fColor;

uniform sampler2D texture;

const float tx = 120.;
const float ty = 250.;
const float ax = 10.;
const float ay = 15.;
//const float PI = 3.14159265358979323846
#  define PI  3.14159265358979323846

void main() 
{ 
    ivec2 ires = textureSize(texture,0);
	float Res = float(ires.s);//Square

	vec2 st = texCoord;
	vec2 xy = Res * st;

	vec2 xy1 = xy + dot(vec2(ax, ay), vec2(sin(2*PI*xy.y/tx),sin(2*PI*xy.x/ty)));
	st = xy1/Res;

	vec3 irgb = texture2D( texture, st ).rgb;
	fColor = vec4( irgb, 1. );
}